// get请求与post请求略有不同，get请求所有参数都在方法的第二个参数中，而post请求的第二个参数为请求参数params，而第三个参数才为配置项。
// 约定： get请求 参数和配置 统一使用data字段  post请求 参数params 配置 config

const http = uni.$u.http;

const VERSION = "v2";
const PLATEFORMSCHOOLFAMILY = "school-family";

// 老师端的成绩录入分页列表
export const teacherPage = (data) =>
	http.get(
		`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/teacher/input/page`, { data }
	);


// 切换年级考试的考试计划中某一门的发布情况

export const teacherInputPage = (classCourseId) =>
	http.get(
		`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/teacher/input/page/${classCourseId}`
	);


// 考试录入
// 参与对象为一个班级
export const inputSave = (data) =>
	http.post(
		`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/input/save`, data
	);


// 获取年级考试同类型的考试计划
export const gradeSamePlanList = (data) => http.post(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/same/plan/list`, data)

// 检查该考试是否有创建
export const inputSaveCheck = (data) => http.post(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/input/save/check`, data)


// 获取考试录入的详情
export const inputDetailId = (classCourseId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/input/detail/${classCourseId}`
)

// 保存考试录入的单科成绩和备注
export const resultSave = (data) => http.post(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/input/result/save`, data
)

// 切换年级考试的考试计划中某一门的发布情况
export const publishToggle = (classCourseId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/plan/publish/detail/toggle/${classCourseId}`
)
// 保存考试录入的单科备注
export const remarkSave = (data) => http.post(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/input/remark/save`, data
)


// 切换发布年级考试计划
export const planPublishToggle = (examId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/plan/publish/toggle/${examId}`
)



// 新增快捷评语
export const quickSave = (data) => http.post(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/simpleCommentary/add`, data
)
// 删除快捷评语
export const quickGet = () => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/simpleCommentary/list`,
)
// 删除快捷评语
export const quickDel = (data) => http.post(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/simpleCommentary/delete/${data}`
)


// 老师端的校领导公布排名分页列表
export const openPage = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/leader/open/page`, { data }
)
// 获取年级考试的详情
export const simpleDetail = (examId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/plan/simple/detail/${examId}`,
)

// 获取领导公布排名的科目列表
export const openCourse = (examId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/leader/open/course/list/${examId}`,
)

// 获取领导公布排名的班级列表
export const openClass = (examId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/leader/open/class/list/${examId}`,
)

// 切换年级考试的考试计划中某一门的班级排名情况
export const classRankToggle = (classCourseId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/plan/classRank/detail/toggle/${classCourseId}`
)

// 切换公布年级考试计划的年级排名
export const gradeRankToggle = (examId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/plan/gradeRank/toggle/${examId}`
)



// 获取年级考试的考试计划发布情况
export const publishDetail = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/plan/publish/detail`, { data }
)



// 分页预览年级考试学生成绩
export const gradePreviewPage = (data) => http.post(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/preview/page`, data)


// 获取班级单科平均分
export const classAverage = (classCourseId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/class/average/${classCourseId}`,
)

// 获取年级平均分
export const gradeAverage = (examId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/average/${examId}`
)



// 删除创建的成绩录入
export const inputDelete = (classCourseId) => http.post(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/input/delete/${classCourseId}`
)


// 获取年级考试的科目列表
export const courseListId = (examId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/course/list/${examId}`)

// 获取年级考试的班级列表
export const classListId = (examId) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/class/list/${examId}`)

/**成绩分析*/

// 老师端的年级考试成绩分析-班级综合分析
export const analysisClassAll = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/analysis/class/all`, { data }
)


// 老师端的年级考试成绩分析-班级单科分析
export const analysisClassSingle = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/analysis/class/single`, { data }
)


// 老师端的年级考试成绩分析-班级单科分析-分数分布
export const analysisClassDistribution = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/analysis/class/single/distribution`, { data }
)

// 老师端的年级考试成绩分析-年级综合分析
export const analysisGradeAll = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/analysis/grade/all`, { data }
)

//老师端的年级考试成绩分析-年级综合分析-排名
export const analysisGredeRank = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/analysis/grade/all/rank`, { data }
)

// 老师端的年级考试成绩分析-年级单科分析
export const analysisGradeSingle = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/analysis/grade/single`, { data }
)
// 老师端的年级考试成绩分析-年级单科分析-分数分布
export const analysisDistribution = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/analysis/grade/single/distribution`, { data }
)
// 老师端的年级考试成绩分析分页列表
export const analysisPage = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/analysis/page`, { data }
)
// 家长端的年级考试成绩分析-整体分析
export const analysisAll = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/student/analysis/all`, { data }
)

// 家长端的年级考试成绩分析-单科分析
export const analysisSingle = (data) => http.get(
	`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/student/analysis/single`, { data }
)

// 获取考试计划班级科目学生列表
export const examStudentList = (data) => http.post(`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/class/student/list`, data)
// 公开考试计划中班级某一门科目班级排名
export const openClassRank = (data) => http.post(`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/open/class/course/classRank`, data)

// 获取考试班级科目发布选择  1
export const classPublishCheck = (params) => http.get(`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/class/course/publish/check/`+params)
// 获取年级考试计划一键发布选择  
export const gradePublishCheck = (params) => http.get(`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/plan/publish/check/`+params)

// 考试计划中班级某一门科目发布   1
export const examClassPublish = (data) => http.post(`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/class/course/publish`, data)
// 考试计划一键发布发布  
export const examGradePublish = (data) => http.post(`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/grade/plan/publish`, data)

// 获取成绩分段-- 
export const analysisSubsection = (data) => http.post(`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/analysis/subsection`, data)
// 自定义分段保存--
export const saveCustomSubsection = (data) => http.post(`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/setting/save/custom/subsection`, data)
// 自定义分段获取--
export const getCustomSubsection = () => http.get(`/${PLATEFORMSCHOOLFAMILY}/${VERSION}/exam/setting/get/custom/subsection`, )
